#include <cstddef>
#include <stdio.h>
#include<malloc.h>
#include <string.h>
typedef char ElemType;
typedef struct LNode
{
	ElemType data;
	struct LNode *next;
}LinkNode;
void Split(LinkNode *&L)
{
    LinkNode *pre,*p,*q;
    if(L->next==NULL||L->next->next==NULL)
        return;
    int x=L->next->data;
    pre=L->next;
    p=pre->next;
    while(p!=NULL)
    {
        if(p->data<x)
        {
            pre->next=p->next;
            p->next=L->next;
            L->next=p;
            p=pre->next;
        }
        else 
        {
            pre=p;
            p=pre->next;
        }
    }

}
void DispList(LinkNode *L);
void DestroyList(LinkNode *&L);
void CreateListR(LinkNode *&L,ElemType a[],int n);
int main()
{
    LinkNode *L;
    ElemType a[]="daxgdchaeb";
    int n=strlen(a);
    printf("解法为：\n");
    CreateListR(L,a,n);
    printf("L:");DispList(L);
    printf("以首结点值进行划分\n");
    Split(L);
    printf("L:");DispList(L);
    DestroyList(L);
    return 1;
}


        